package com.JL.test;

import com.JL.engine.model.Entity;
import com.JL.engine.model.EntityFactory;
import com.JL.engine.model.InitData;
import com.JL.engine.model.View;

import java.awt.*;

public class MouseEntityFactory implements EntityFactory {
    @Override
    public String getEntityName() {
        return "mouse";
    }

    @Override
    public Entity create(InitData initData) {
        Entity mouse =new Entity();
        mouse.addView(new View() {
            @Override
            public void draw(Graphics g, Entity entity) {
                g.setColor(Color.RED);
                g.drawString(entity.getX()+","+entity.getY(),(int)entity.getX(),(int)entity.getY());
            }
        });
        return mouse;
    }
}
